import com.example.c3p0.Util.C3p0Util;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

/**
 * @auther 尚智江
 * @Date 2022/5/14 22:35
 */
public class DeleteDao {
    public static void main(String[] args) throws SQLException {
        // 创建 QueryRunner对象
        QueryRunner queryRunner = new QueryRunner(C3p0Util.getDataSource());
        String sql = "DELETE FROM user WHERE user='hellaaa'";
        int num = queryRunner.update(sql);
        if(num>0){
            System.out.println("删除成功！");
        }else {
            System.out.println("删除失败");
        }
    }
}
